Ext.define('Intranet.Desktop.view.TeamGroupsView', {
    extend: 'Ext.view.View',
    alias: 'widget.desktop_teamgroupsview',
    id: 'teamgroups-icon',
    uses: 'Ext.data.Store',
    singleSelect: true,
    overItemCls: 'x-view-over',
    itemSelector: 'div.thumb-wrap',
    border: false,
    tpl: [
        '<tpl for=".">',
            '<tpl if="group_id==2">',
                '<div class="thumb-wrap">',
                    '<div class="thumb">',
                        '<img src="app/modules/{key_name}/images/icons/{icon}" height="48"/>',
                    '</div>',
                '</div>',
            '</tpl>',
        '</tpl>'
    ],
    initComponent: function()
    {

        this.store = Ext.create('Ext.data.Store', {
            autoLoad: true,
            fields: ['description', 'group_id', 'icon',
                'key_name', 'mid', 'name', 'state',
               'uid', 'weight'],
            proxy: {
                type: 'ajax',
                url: '/src/public/module/modulesusers/getModules',
                reader: {
                    type: 'json',
                    root: 'modules'
                }
            }
        });

        this.callParent(arguments);
        this.store.sort();
    }

});


